package org.liveboardgames.agricola.control.delegates.action.processor
{
    import org.liveboardgames.agricola.model.AgricolaModelLocator;
    import org.liveboardgames.agricola.model.PopupModel;
    import org.liveboardgames.agricola.vo.action.Action;
    import org.liveboardgames.agricola.vo.player.Player;
    
    public class PloughActionProcessor extends ActionProcessor
    {
        public function PloughActionProcessor(action:Action)
        {
            super(action);
        }
        
        override public function execute():void
        {
            var player:Player = action.target as Player;
            
            // Compute the number of fields that can be ploughed (can vary with 
            // cards for instance)
            // For now, default to 1
            var numberOfPloughedFields:int = 1;
            
            AgricolaModelLocator.getInstance().popups.currentActionPopupIndex = PopupModel.POPUP_PLOUGH_FIELD_INDEX;
            AgricolaModelLocator.getInstance().popups.numberOfFieldsToPlough = numberOfPloughedFields;
        }
    }
}